package com.iraeta.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iraeta.entity.Student;
import com.iraeta.mapper.StudentMapper;
import com.iraeta.service.IStudentService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IStudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {
    @Override
    public List<Student> listStudentByName(String name) {
        QueryWrapper<Student> qw = new QueryWrapper<>();
        qw.like("name", name);
        return baseMapper.selectList(qw);
    }

    /*这个是xml的*/
    @Override
    public List<Student> listStudentByAge(int minAge, int maxAge) {
        return baseMapper.selectStudentByAge(minAge, maxAge);
    }
}
